<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户页面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #f4f4f4;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            background: white;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        h1 {
            color: #333;
        }
        .nav {
            margin: 20px 0;
            padding: 10px 0;
            border-top: 1px solid #eee;
            border-bottom: 1px solid #eee;
        }
        .nav a {
            margin-right: 15px;
            text-decoration: none;
            color: #007bff;
        }
        .content {
            margin-top: 20px;
            padding: 15px;
            background-color: #e9f7ef;
            border-radius: 5px;
        }
        .user-info {
            background-color: #f8f9fa;
            padding: 15px;
            border-radius: 5px;
            margin-top: 20px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>用户页面</h1>
        
        <div class="nav">
            <a th:href="@{/}">首页</a>
            <a th:href="@{/user}">用户页面</a>
            <a th:href="@{/admin}">管理员页面</a>
            
            <!-- 注销链接 -->
            <form th:action="@{/logout}" method="post" style="display:inline;">
                <button type="submit" style="background:none;border:none;color:#007bff;cursor:pointer;padding:0;">注销</button>
            </form>
        </div>
        
        <div class="content">
            <h2>欢迎访问用户页面</h2>
            <p>这个页面只有拥有USER角色的用户才能访问。</p>
            
            <div class="user-info">
                <h3>当前用户信息</h3>
                <p>用户名: <strong th:text="${username}"></strong></p>
            </div>
        </div>
    </div>
</body>
</html>